import torch
import torch.nn as nn

def create_model(input_shape):
    class LSTMModel(nn.Module):
        def __init__(self, input_size, hidden_size=64):
            super().__init__()
            self.lstm1 = nn.LSTM(input_size, hidden_size, batch_first=True)
            self.dropout1 = nn.Dropout(0.2)
            self.lstm2 = nn.LSTM(hidden_size, 32, batch_first=True)
            self.dropout2 = nn.Dropout(0.2)
            self.fc = nn.Linear(32, 2)
        
        def forward(self, x):
            x, _ = self.lstm1(x)
            x = self.dropout1(x)
            x, _ = self.lstm2(x)
            x = self.dropout2(x)
            return self.fc(x[:, -1, :])
    
    return LSTMModel(input_shape[1])